<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>法定天数管理</title>
<link href="styles/Master.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/common.js"></script>
<script type="text/javascript" src="scripts/message.js"></script>

<script type="text/javascript" src="scripts/system/legal_days_list.js"></script>

<style>

</style>

<script>
var gridCount = '<s:property value="legalDaysListSize"/>' * 1;
var path = '<%=path%>';
var rangeTypeRadio = "";
<s:iterator value="rangeTypeList" id="rangeType" status="stat">
<s:if test="#stat.index==0">
rangeTypeRadio = rangeTypeRadio + "&nbsp;<input type='radio' name='legalDaysList[{0}].rangeType' checked='checked' value='<s:property value='#rangeType.columeId'/>'/><label><s:property value='#rangeType.name'/></label>";
</s:if>
<s:else>
rangeTypeRadio = rangeTypeRadio + "&nbsp;<input type='radio' name='legalDaysList[{0}].rangeType' value='<s:property value='#rangeType.columeId'/>'/><label><s:property value='#rangeType.name'/></label>";
</s:else>
</s:iterator>
</script>

</head>

<body>
<s:form name="legalDaysListForm" id="legalDaysListForm" action="legalDays-list" namespace="/system" method="post">

	<s:hidden id="isSuccess" value="%{isSuccess}"></s:hidden>
	<s:hidden id="legalDaysId" name="legalDaysId"></s:hidden>
	<h2 style="text-align: left">法定天数管理</h2>
	<hr width="100%" align="left" size="1" color="#E1EEF8">

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td align="right" width="100%" rowspan="2">
				<input type="image" src="<%=basePath%>images/search.jpg" onclick="search();"></input>
			</td>
		</tr>
	</table>
	<br/>
	
	<div style="padding: 4px 0pt; text-align: right;">
		<input type="button" value="新增法定天数" class="btn_mouseout" onclick="addRow();"
			onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
			onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
	</div>
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabHeader" id="legalDays">
		<thead>
			<tr align="center" class="tdBg">
				<td style="text-align: center" nowrap="nowrap" width="30%">工作年限</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">法定天数</td>
				<td style="text-align: center" nowrap="nowrap" width="40%">备注</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">排序</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">操作</td>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="legalDaysList" id="legalDays" status="stat">
				<tr id='row_<s:property value='#stat.index' />'>
					<td>
						<s:hidden name="legalDaysList[%{#stat.index}].legalDaysId"></s:hidden>
						<s:textfield name="legalDaysList[%{#stat.index}].years" cssStyle="width: 50%;text-align:right;" onblur="checkInt(this.value, event);" maxlength="10"></s:textfield>
						<s:radio list="#request.rangeTypeList" name="legalDaysList[%{#stat.index}].rangeType" listKey="columeId" listValue="name" required="true" value="#legalDays.rangeType"></s:radio>
					</td>
					<td>
						<s:textfield name="legalDaysList[%{#stat.index}].days" cssStyle="width: 99%;text-align:right;" onkeydown="checkInt(this.value, event)" maxlength="10"></s:textfield>
					</td>
					<td>
						<s:textfield name="legalDaysList[%{#stat.index}].remark" cssStyle="width: 99%" onblur="checkStr(this, '备注', 1000);"></s:textfield>
					</td>
					<td>
						<s:textfield name="legalDaysList[%{#stat.index}].priority" cssStyle="width: 99%;text-align:right;" onblur="checkInt(this.value, event);" maxlength="10"></s:textfield>
					</td>
					<td nowrap="nowrap" align="center">
			    		<a href="javascript: void(0);" onclick="deleteLegalDays('<s:property value='#legalDays.legalDaysId' />'); return false;">
							<img src="images/delete.jpg" style="vertical-align: middle" border="0">删除&nbsp;&nbsp;
						</a>
					</td>
				</tr>
			</s:iterator>

		</tbody>
	</table>
	<center>
		<div style="padding: 4px 0pt;">
			<input type="button" value="保存" class="btn_mouseout" onclick="save();"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
		</div>
	</center>
</s:form>
</body>
</html>